package cn.buk.tms.train.service;

import cn.buk.common.JsonResult;
import cn.buk.tms.dto.TrainRefundOrderDto;
import cn.buk.tms.entity.misc.OperationLog;
import cn.buk.tms.train.sc.TrainOrderSearchCriteria;

import java.util.List;

/**
 * 火车票退票订单服务接口
 */
public interface TrainRefundOrderService {

    /**
     * 查找订单
     */
    List<TrainRefundOrderDto> searchOrders(int enterpriseId, int userId, TrainOrderSearchCriteria sc);

    /**
     * 查找
     */
    TrainRefundOrderDto getOrderById(int enterpriseId, int userId, int orderId);

    /**
     * 创建订单
     */
    JsonResult createOrder(int enterpriseId, String username, TrainRefundOrderDto dto);

    /**
     * 修改订单备注
     */
    JsonResult updateOrderRemark(int enterpriseId, String username, int orderId,
                                 String remark);

    /**
     * 修改外部订单号
     */
    JsonResult updateOrderExternalOrderNo(int enterpriseId, String username, int orderId,
                                          String externalOrderNo);

    /**
     * 修改订单的价格
     */
    JsonResult updateOrderPrice(int enterpriseId, String username, int orderId, double price,
                                double cost, double serviceCharge);

    JsonResult processOrder(int enterpriseId, String username, int orderId);

    /**
     * 火车票退票订单处理完毕
     */
    JsonResult finishOrder(int enterpriseId, String username, int orderId, String remark);

    List<OperationLog> searchOrderHistory(int enterpriseId, int orderId);

    /**
     * 取消火车票退票订单
     */
    JsonResult cancelOrder(int enterpriseId, String username, int orderId, String remark);


    /**
     * 回滚火车票退票订单
     */
    JsonResult rollbackOrder(int enterpriseId, String username, int orderId,
                             final String remark);

    void autoAlertOrderStatus();
}
